package com.liujing.simplefactory;

/**
 * @program: DesignPattenDemo
 * @description:
 * @author: liujing
 * @create: 2019-11-21 09:55
 **/
public class OperationDiv extends Operation {
    @Override
    public double getResult() {
        double result = 0;
        if (0 == getNumberB()) {
            try {
                throw new Exception("除数不能为0");
            } catch (Exception e) {
                e.printStackTrace();
            }
        }
        return getNumberA() / getNumberB();
    }
}
